package com.gok.seasonmovie.mapper;

import com.gok.seasonmovie.entity.Movie;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;

import java.util.List;

@Mapper
public interface MovieMapper {

    @Select("select * from movies")
    List<Movie> findAll();
    @Select("select * from movies WHERE id=#{id}")
    List<Movie> getMovieByMid(@Param("id") String id);

    @Select("SELECT * FROM movies WHERE name LIKE CONCAT('%', #{keyword}, '%')")
    List<Movie> searchMovies(@Param("keyword") String keyword);

}
